<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>08_原型对象-解决内存占用较大问题</title>
    </head>
    <body>
        <script>
             function Villa(vStyle,vPrice){
                this.vStyle = vStyle;
                this.vPrice = vPrice;
                // this.live = function(){
                //     console.log('住着很舒服，买一个台球桌');
                // }
            }

            Villa.prototype.live = function(){
                console.log('住着很舒服，买一个台球桌');
            }

            var v1 = new Villa('新中式',500);
            var v2 = new Villa('欧式',800);
            console.log(v1.live == v2.live);
            // --------------------------------

            var arr = new Array(1,2,3,4);
            var arr1 = new Array(2,2,4,5);

            console.log(arr);

            console.log(arr.push == arr1.push);
            console.log(arr.pop == arr1.pop);
            console.log(arr.shift == arr1.shift);

        </script>
    </body>
</html>